home *** CD-ROM | disk | FTP | other *** search
/ Practical Web Pages 2004 September / PracticalWebPages-WPG13-09-2004-Coverdisc.iso / pc / Software / Toolkit / Sothink SWF Quicker 1.5 / data1.cab / Public_Files / Effects / ActionScript / Interactive / MagneticMouse.sqe < prev    next >
Encoding:
Text File  |  2004-06-14  |  2.1 KB  |  78 lines

  1. ========== Description Part Begin ==========
  2. name = "Magnetic Mouse";
  3. description = "When you mouse over a character, the character will be magnetized.";
  4. version = "1.00";
  5. bin = "MagneticMouse.bin";
  6. ========== Description Part End ==========
  7.  
  8. ========== Parameter Part Begin ==========
  9. $nCharacterCount(EDIT,INT,1,1 10000,"Total Characters ","The total characters using the special effect. The value is defined by the selected characters in the movie, but can not be changed in the property box.");
  10. $nFrameCount(EDIT,INT,3,3 3,"Total Frames","It indicates the total frames of actions. The total frames of the effect is probably more than it.");
  11. $nSize(EDIT,INT,200,100 1000,"Size","The maximum size of characters to be changed.");
  12.  
  13. ========== Parameter Part End ==========
  14.  
  15. ========== Function Part Begin ==========
  16. nCharacterCount = 4;
  17. nFrameCount = 10;
  18.  
  19.  
  20.  
  21. nOriginalSizeX = new Array(nCharacterCount);
  22. nOriginalSizeY = new Array(nCharacterCount);
  23. for (i = 1; i <= nCharacterCount; i++)
  24. {
  25.         nOriginalSizeX[i - 1] = this["c" + i ]._xscale;
  26.         nOriginalSizeY[i - 1] = this["c" + i ]._yscale;
  27. }
  28.  
  29.  
  30.  
  31. function fun(tar, accel, convert,i) 
  32.         xScale = xScale * accel + (tar - this["c" +i]._xscale) * convert; 
  33.         yScale = yScale * accel + (tar - this["c" +i]._yscale) * convert; 
  34.         this["c" +i]._xscale += xScale; 
  35.         this["c" +i]._yscale += yScale;
  36. }
  37.     
  38. function funChangeSize()
  39. {
  40.     
  41.     for( n = 1; n <= nCharacterCount;n++)
  42.     {
  43.         
  44.         if(this["c" + n].hitTest(_root._xmouse,_root._ymouse,false))
  45.         {
  46.             fun(nSize,0.7,0.4,n);
  47.         }
  48.         else
  49.         if (!this["c" + n].hitTest(_root._xmouse,_root._ymouse,false))
  50.         {
  51.             if (this["c" + n]._xscale > nOriginalSizeX[n - 1])
  52.             {
  53.                 fun(nOriginalSizeX[0],0.7,0.4,n);
  54.             }
  55.             else
  56.             {
  57.                 this["c" + n]._xscale = nOriginalSizeX[n - 1];
  58.                 this["c" + n]._yscale = nOriginalSizeY[n - 1];
  59.             }
  60.         }
  61.     }
  62.  
  63. }
  64.  
  65.  
  66. function again()
  67. {
  68.     gotoAndPlay(2);
  69. }
  70.  
  71.  
  72. ========== Function Part End ==========
  73.  
  74. ========== Frame Part Begin ==========
  75. $frame(funChangeSize,2,-1,"funChangeSize");
  76. $frame(again,3,-1,"again");
  77. ========== Frame Part End ==========